<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
    template="layout/template.xhtml">

<ui:define name="body">

    <rich:panel>
        <f:facet name="header">Student admission Details</f:facet>

        <s:decorate id="id" template="layout/display.xhtml">
            <ui:define name="label">Id</ui:define>
            <h:outputText value="#{studentAdmissionHome.instance.id}"/>
        </s:decorate>

        <s:decorate id="admissionDate" template="layout/display.xhtml">
            <ui:define name="label">Admission date</ui:define>
            <h:outputText value="#{studentAdmissionHome.instance.admissionDate}">
                <s:convertDateTime type="date" dateStyle="short"/>
            </h:outputText>
        </s:decorate>

        <s:decorate id="admissionFeeAmount" template="layout/display.xhtml">
            <ui:define name="label">Admission fee amount</ui:define>
            <h:outputText value="#{studentAdmissionHome.instance.admissionFeeAmount}"/>
        </s:decorate>

        <s:decorate id="specialFeeAmount" template="layout/display.xhtml">
            <ui:define name="label">Special fee amount</ui:define>
            <h:outputText value="#{studentAdmissionHome.instance.specialFeeAmount}"/>
        </s:decorate>

        <s:decorate id="paymentDate" template="layout/display.xhtml">
            <ui:define name="label">Payment date</ui:define>
            <h:outputText value="#{studentAdmissionHome.instance.paymentDate}">
                <s:convertDateTime type="date" dateStyle="short"/>
            </h:outputText>
        </s:decorate>

        <s:decorate id="eligibleForScholarship" template="layout/display.xhtml">
            <ui:define name="label">Eligible for scholarship</ui:define>
            <h:outputText value="#{studentAdmissionHome.instance.eligibleForScholarship}"/>
        </s:decorate>

        <div style="clear:both"/>

    </rich:panel>

    <div class="actionButtons">

        <s:button view="/StudentAdmissionEdit.xhtml"
                    id="edit"
                 value="Edit"/>

        <s:button view="/#{empty studentAdmissionFrom ? 'StudentAdmissionList' : studentAdmissionFrom}.xhtml"
                    id="done"
                 value="Done"/>

    </div>

    <rich:tabPanel switchType="ajax">

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/manytoone.gif" style="vertical-align: middle; padding-right: 4px;"/>Student </h:panelGroup>
        </f:facet>
    <div class="association" id="studentAdmissionParent">

        <h:outputText value="There is no student associated with this studentAdmission."
                   rendered="#{studentAdmissionHome.instance.student == null}"/>

        <rich:dataTable var="_studentAdmission"
                   value="#{studentAdmissionHome.instance.student}"
                rendered="#{studentAdmissionHome.instance.student != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="studentAdmissionTable">
            <h:column>
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_studentAdmission.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Student id</f:facet>
                <h:outputText value="#{_studentAdmission.student.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Parent id</f:facet>
                <h:outputText value="#{_studentAdmission.parent.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Admission date</f:facet>
                <h:outputText value="#{_studentAdmission.admissionDate}">
                    <s:convertDateTime type="date" dateStyle="short"/>
                </h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">Admission fee amount</f:facet>
                <h:outputText value="#{_studentAdmission.admissionFeeAmount}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Special fee amount</f:facet>
                <h:outputText value="#{_studentAdmission.specialFeeAmount}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Payment date</f:facet>
                <h:outputText value="#{_studentAdmission.paymentDate}">
                    <s:convertDateTime type="date" dateStyle="short"/>
                </h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">Eligible for scholarship</f:facet>
                <h:outputText value="#{_studentAdmission.eligibleForScholarship}"/>
            </h:column>
            <h:column styleClass="action">
                <f:facet name="header">Action</f:facet>
                <s:link id="viewstudentAdmission"
                     value="View"
                      view="/StudentAdmission.xhtml">
                    <f:param name="studentAdmissionId"
                           value="#{_studentAdmission.id}"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </div>
    </rich:tab>

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/manytoone.gif" style="vertical-align: middle; padding-right: 4px;"/>Parent</h:panelGroup>
        </f:facet>
    <div class="association" id="parentParent">

        <h:outputText value="There is no parent associated with this studentAdmission."
                   rendered="#{studentAdmissionHome.instance.parent == null}"/>

        <rich:dataTable var="_parent"
                   value="#{studentAdmissionHome.instance.parent}"
                rendered="#{studentAdmissionHome.instance.parent != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="parentTable">
            <h:column>
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_parent.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">UserAccount id</f:facet>
                <h:outputText value="#{_parent.userAccount.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Student id</f:facet>
                <h:outputText value="#{_parent.student.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Relationship id</f:facet>
                <h:outputText value="#{_parent.relationship.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Address id</f:facet>
                <h:outputText value="#{_parent.address.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">First name</f:facet>
                <h:outputText value="#{_parent.firstName}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Last name</f:facet>
                <h:outputText value="#{_parent.lastName}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Mobile number</f:facet>
                <h:outputText value="#{_parent.mobileNumber}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Office phone</f:facet>
                <h:outputText value="#{_parent.officePhone}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Email</f:facet>
                <h:outputText value="#{_parent.email}"/>
            </h:column>
            <h:column styleClass="action">
                <f:facet name="header">Action</f:facet>
                <s:link id="viewparent"
                     value="View"
                      view="/Parent.xhtml">
                    <f:param name="parentId"
                           value="#{_parent.id}"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </div>
    </rich:tab>

    </rich:tabPanel>
</ui:define>

</ui:composition>
